using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Umdf.SideShow.Scf.ObjectModel
{
    public class ScfTextData : ScfObject
    {
        private string _text = string.Empty;
        private Color _color = Color.Black;
        private bool _emphasized = false;
        private bool _lineBreak = false;

        public ScfTextData()
        {
        }

        public ScfTextData(string text, Color color, bool emphasized)
        {
            _text = text;
            _color = color;
            _emphasized = emphasized;
        }

        public ScfTextData(bool lineBreak)
        {
            _lineBreak = lineBreak;
        }

        public string Text
        {
            get { return _text; }
            set { _text = value; }
        }

        public Color Color
        {
            get { return _color; }
            set { _color = value; }
        }

        public bool Emphasized
        {
            get { return _emphasized; }
            set { _emphasized = value; }
        }

        public bool LineBreak
        {
            get { return _lineBreak; }
            set { _lineBreak = value; }
        }

        protected internal override void SerializeObject(System.IO.BinaryWriter writer)
        {
            base.SerializeObject(writer);
            writer.Write(_text);
            writer.Write(_color.ToArgb());
            writer.Write(_emphasized);
            writer.Write(_lineBreak);
        }

        protected internal override void DeserializeObject(System.IO.BinaryReader reader)
        {
            base.DeserializeObject(reader);
            _text = reader.ReadString();
            _color = Color.FromArgb(reader.ReadInt32());
            _emphasized = reader.ReadBoolean();
            _lineBreak = reader.ReadBoolean();
        }
    }
}
